const test = {
  name: "abc",
  value1: {
    name: 'Dinah'
  }
};

const v = test.value2?.name;
console.log(v);
